#include "sgescalculator.h"

SGESCalculator::SGESCalculator(QWidget *parent)
    : QMainWindow(parent)
{

	ui.setupUi(this);
	//connection des slots
	QObject::connect(ui.doubleSpinBox,SIGNAL(valueChanged(double)),this,SLOT(calcul(double)));
	ui.doubleSpinBox->setMaximum(20.00);

	this->setWindowIcon(QIcon("/usr/share/sgescalculator/pix/58149.xpm"));

}

SGESCalculator::~SGESCalculator()
{

}

void SGESCalculator::calcul(double rep){
	rep = rep*0.6;
	if (rep>= 10){
		ui.label->setText("Sges OK");
		ui.label_2->setText("Sges OK");
	}else{
		rep=(10-rep)/0.4;
		ui.label_2->setText(QString::number(rep,'g',4));
		ui.label->setText("Need");
	}

}
